home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 10-03.C < prev    next >
Text File  |  1992-01-31  |  758b  |  41 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    int old_mode;
  10.    int x;
  11.  
  12.    /* initialize the video environment */
  13.  
  14.    if (fg_testmode(13,1) == 0) {
  15.       printf("This program requires EGA.\n");
  16.       exit(1);
  17.       }
  18.    old_mode = fg_getmode();
  19.    fg_setmode(13);
  20.    fg_setfunc(3);
  21.  
  22.    /* draw some type of background */
  23.  
  24.    fg_setcolor(15);
  25.    fg_rect(0,319,0,199);
  26.  
  27.    /* move the object across the screen */
  28.  
  29.    fg_setcolor(10^15);
  30.    for (x = -20; x < 320; x+=5) {
  31.       fg_clprect(x,x+19,95,104);
  32.       fg_waitfor(1);
  33.       fg_clprect(x,x+19,95,104);
  34.       }
  35.  
  36.    /* restore the original video mode and return to DOS */
  37.  
  38.    fg_setmode(old_mode);
  39.    fg_reset();
  40. }
  41.